//
// Created by THE13 on 2024/2/6.
//
#include "page_model.h"


/* User Variables ---------------------------------------------------------*/
menu_t * node;
menu_t * pageMain;
menu_t * pageShow;
menu_t * pageIcon;
menu_t * pageData;
menu_t * pageText;


void page_model_init()
{
    //Node
    node = AddNode(node,"Head Node");
    //页面
    pageMain = AddPage(node,LIST,"NANO");
    pageShow = AddPage(node,LIST,"[LIST]");
    pageIcon = AddPage(node,ICON,"[ICON]");
    pageData = AddPage(node,DATA,"[DATA WINDOW]");
    pageText = AddPage(node,TEXT,"[ABOUT USER]");
    //选项
    AddItem(pageMain,ITEM_CALL_PAGE,"LIST1",nullptr,pageShow->id,0, nullptr);
    AddItem(pageMain,ITEM_CALL_PAGE,"ICON PAGE",nullptr,pageIcon->id,0,nullptr);
    AddItem(pageMain,ITEM_CALL_PAGE,"DATA WINDOW",nullptr,pageData->id,0,nullptr);
    AddItem(pageMain,ITEM_CALL_PAGE,"ABOUT USER",nullptr,pageText->id,0,nullptr);
    AddItem(pageMain,ITEM_CHECKBOX ,"Check Box" ,nullptr,pageText->id,0,nullptr);
    AddItem(pageMain,ITEM_CHECKBOX ,"Check Box2" ,nullptr,pageText->id,0,nullptr);
    AddItem(pageMain,ITEM_TEXT ,"BAR" ,nullptr,0,0,nullptr);
    //选项
    AddItem(pageShow,ITEM_CALL_PAGE,"CHICHIBOOM UI",NULL,pageMain->id,0,NULL);
    AddItem(pageShow,ITEM_CALL_PAGE,"ICON PAGE",NULL,pageIcon->id,0,NULL);

//    AddItem(pageIcon,ITEM_CALL_PAGE,"CHICHIBOOM UI",(uint16_t *)gImage_left,pageMain->id,0,NULL);//Item id 自动分配
//    AddItem(pageIcon,ITEM_SWITCH,"ENCODER",(uint16_t *)gImage_ubuntu,0,0,NULL);
//    AddItem(pageIcon,ITEM_SWITCH,"SWITCH",(uint16_t *)gImage_switch,0,0,NULL);//Item id 自动分配
//    AddItem(pageIcon,ITEM_SWITCH,"Windows",(uint16_t *)gImage_windows,0,0,NULL);
//    AddItem(pageIcon,ITEM_SWITCH,"Robot",(uint16_t *)gImage_robot,0,0,NULL);//Item id 自动分配

    //call back
    AddItem(pageData,ITEM_CALL_PAGE,"Call CHICHIBOOM UI",NULL,pageMain->id,0,NULL);
    //call back
    AddItem(pageText,ITEM_CALL_PAGE,"Call CHICHIBOOM UI",NULL,pageMain->id,0,NULL);

    SysInfo_init(node);//索引指针指向第一页的第一项
}

